package com.lyn.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class TimeUtil {

    public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
    public static SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String getTime(long timestamp) {
        return simpleDateFormat.format(new Date(timestamp));
    }

    public static long getTimeStamp(String time) {
        Date date = null;
        try {
            date = simpleDateFormat2.parse(time);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return date.getTime();
    }
}
